<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/layui/css/layui.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
</head>
<body>
	<form method="post" onsubmit="return false" id="formId">
		编号:<input type="hidden" name="id" value="${department.id}"/><br/>
		部门<select id="selectId" name="name"></select><br/>
	</form>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layui/layui.js" ></script>
	<script src="<%=request.getContextPath()%>/static/lib/jquery/jquery-1.11.1.js"></script>
	<script src="${pageContext.request.contextPath}/static/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath()%>/static/common/mylayer.js"></script>
	<script type="text/javascript">
	layui.use('layer', function(){
		  var layer = layui.layer;
	})
		$(function(){
			$.ajax({
				type : "POST",
				dataType : "json",
				url : "${pageContext.request.contextPath}/user/getDepartmentSelect.action",
				success : function(resp){
					var jsonObj = resp.data;
					var html = "<option>--请选择--</option>";
					for(var i=0;i<jsonObj.length;i++){
						html += "<option value='"+jsonObj[i].id+"'>"+jsonObj[i].name+"</option>";
					}
					$("#selectId").html(html);
				}
			})
		})
	</script>
</body>
</html>